import React from 'react';
import classNames from 'classnames';
import { FontAwesomeIcon, FontAwesomeIconProps } from '@fortawesome/react-fontawesome';


export type ThemeProps = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';

export interface IconProps extends FontAwesomeIconProps {
    theme?: ThemeProps;
    className?: string;
}

const Icon = (props: IconProps) => {
    const { className, theme, ...restProps } = props;

    // icon-primary
    // icon-secondary
    // icon-success


    const classes = classNames('icon', className, {
        [`icon-${theme}`]: theme,
    });
    return (
        <FontAwesomeIcon className={classes} {...restProps} />
    )
}

export default Icon;